home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 19
/
Aminet 19 (1997)(GTI - Schatztruhe)[!][Jun 1997].iso
/
Aminet
/
mods
/
misc
/
CUST_Agony_MON.lha
/
Agony_MON
/
AgonyCommon.s
< prev
next >
Wrap
Text File
|
1997-04-06
|
6KB
|
328 lines
*
* Common part for Agony's custom modules by Jeroen Tel
*
IFEQ AGO_TEST-0 ; COMPLETE VERSION
AGO_StructAnalyzer ; transmis à EaglePlayer pour gérer
ds.l UPS_SizeOF ; les analyzers
*-----------------------------------------------------------------------*
;
; Init Player
InitPlay
move.l dtg_AudioAlloc(a5),a0 ; Function
jmp (a0)
*-----------------------------------------------------------------------*
;
; End Player
EndPlay
move.l dtg_AudioFree(a5),a0 ; Function
jmp (a0)
*-----------------------------------------------------------------------*
;
; Init Custom Replay Routine
AGO_init
move.w dtg_SndNum(a5),d0 ; sub song nbr (1..7)
bra AGO_InitSong
*-----------------------------------------------------------------------*
;
; Clear Audio Reg.
AGO_end
move.w #$f,$dff096
clr.w $dff0a8
clr.w $dff0b8
clr.w $dff0c8
clr.w $dff0d8
rts
*-----------------------------------------------------------------------*
;
; Interrupt routine called every 1/80 s
AGO_Play
bra AGO_InterVBL
*-----------------------------------------------------------------------*
;
; Returns min and max sub song
AGO_SubSongRange
moveq #1,d0 ; min
moveq #1,d1 ; max
rts
*-----------------------------------------------------------------------*
;
; Set Volume
AGO_Volume
move.w dtg_SndLBal(a5),d0 ; Vol Left
mulu dtg_SndVol(a5),d0 ; Vol Max
lsr.w #6,d0
move.w d0,AGO_MasterVolA ; final Vol Left
move.w d0,AGO_MasterVolD
move.w dtg_SndRBal(a5),d0
mulu dtg_SndVol(a5),d0
lsr.w #6,d0
move.w d0,AGO_MasterVolB
move.w d0,AGO_MasterVolC
rts
*-----------------------------------------------------------------------*
;
; Set DMA Voices
AGO_SetVoices
or.w #$8000,d0
move.w d0,AGO_DMA_EP ; bit=1 <=> voice is ON
rts
*-----------------------------------------------------------------------*
;
; Returns address of the UPS structure to EaglePlayer
AGO_StructInit
lea AGO_StructAnalyzer(pc),a0
rts
*-----------------------------------------------------------------------*
ELSEIF ; TESTVERSION
;-------
; Small code to test the player under a debugger
AGO_Debug
moveq #1,d0
bsr AGO_InitSong
move.l $6c.w,Jmp+2
move.l #Vbl,$6c.w
rts
End
;; bsr StopSong
move.l Jmp+2(pc),$6c.w
move.w #$f,$dff096
rts
Vbl
btst #5,$dff01f
beq.s Jmp
.wa cmp.b #70,$dff006
blt.s .wa
move.w #$f00,$dff180
movem.l d0-a6,-(a7)
bsr AGO_InterVBL
movem.l (a7)+,d0-a6
move.w #$345,$dff180
Jmp jmp 0.l
AGO_StructAnalyzer ; transmis à EaglePlayer pour gérer
ds.l UPS_SizeOF ; les analyzers
ENDC
;------------------------------------------------------------------------
; Données pour EaglePlayer / Delitracker
AGO_DMA_EP dc.w %1111+$8000 ; voix actives depuis EaglePlayer
AGO_MasterVolA dc.w 64 ; 0 .. 64
AGO_MasterVolB dc.w 64
AGO_MasterVolC dc.w 64
AGO_MasterVolD dc.w 64
AGO_StructA dc.l AGO_StructAnalyzer
AGO_StructB dc.l AGO_StructAnalyzer+UPS_Modulo
AGO_StructC dc.l AGO_StructAnalyzer+UPS_Modulo*2
AGO_StructD dc.l AGO_StructAnalyzer+UPS_Modulo*3
AGO_OldPer1 dc.w -1
AGO_OldPer2 dc.w -1
AGO_OldPer3 dc.w -1
AGO_OldPer4 dc.w -1
;-----------------------------------------------------------------------
; Agony InGame Musics.
; Original musics by Jeroen Tel / MON in 1990.
; Relocated on 06/04/97 by Mr.STYCKX
;
; AGO_InitSong : D0 = -
; AGO_InterVBL : called every VBL
;
;-----------------------------------------------------------------------
; Init la subsong D0
AGO_InitSong
bsr RelocMus
lea MusicData(pc),a0
move.l #$61000000,d0
lea SetON(pc),a1
lea DMAON_-ABS_START+2(a0),a2
sub.l a2,a1
move.w a1,d0
move.l d0,-2(a2) ; bsr SetON
lea SetOFF(pc),a1
lea DMAOFF_-ABS_START+2(a0),a2
sub.l a2,a1
move.w a1,d0
move.l d0,-2(a2) ; bsr SetOFF
lea SetPer(pc),a1
lea PER_-ABS_START+2(a0),a2
sub.l a2,a1
move.w a1,d0
move.l d0,-2(a2) ; bsr SetPer
lea SetVol(pc),a1
lea VOL_-ABS_START+2(a0),a2
sub.l a2,a1
move.w a1,d0
move.l d0,-2(a2) ; bsr SetVol
lea SetStart(pc),a1
lea START_-ABS_START+2(a0),a2
sub.l a2,a1
move.w a1,d0
move.l d0,-2(a2) ; bsr SetStart
lea SetLen(pc),a1
lea LEN_-ABS_START+2(a0),a2
sub.l a2,a1
move.w a1,d0
move.l d0,-2(a2) ; bsr SetLen
lea SetRStart(pc),a1
lea RSTART_-ABS_START+2(a0),a2
sub.l a2,a1
move.w a1,d0
move.l d0,-2(a2) ; bsr SetRStart
lea SetRLen(pc),a1
lea RLEN_-ABS_START+2(a0),a2
sub.l a2,a1
move.w a1,d0
move.l d0,-2(a2) ; bsr SetRLen
bra MusicData+INIT_-ABS_START
;-----------------------------------------------------------------------
; Routine appelée à chaque VBL
AGO_InterVBL
movem.l D0/A0,-(SP)
lea AGO_StructAnalyzer(pc),a0
move.w #-1,UPS_Enabled(a0)
move.w #UPSB_Adr!UPSB_Len!UPSB_Per!UPSB_Vol!UPSB_DMACon,UPS_Flags(a0)
move.w UPS_Voice1Per(a0),AGO_OldPer1
move.w UPS_Voice2Per(a0),AGO_OldPer2
move.w UPS_Voice3Per(a0),AGO_OldPer3
move.w UPS_Voice4Per(a0),AGO_OldPer4
clr.w UPS_Voice1Per(a0)
clr.w UPS_Voice2Per(a0)
clr.w UPS_Voice3Per(a0)
clr.w UPS_Voice4Per(a0)
move.w AGO_DMA_EP(pc),d0
move.w d0,UPS_DMACon(a0)
not.w d0
and.w #$f,d0
move.w d0,$dff096 ; stop voices from EP
bsr MusicData+VBL_-ABS_START
; La replay de Nebulus remet la période à chaque VBL,ce qui perturbe
; les analyzers. On ne transmet donc une période que si elle est
; différente de la VBL précédente.
lea AGO_StructAnalyzer(pc),a0
move.w UPS_Voice1Per(a0),d0
cmp.w AGO_OldPer1(pc),d0 ; nouvelle fréquence
bne.s .2 ; oui
clr.w UPS_Voice1Per(a0) ; non, on remet a 0
.2 move.w UPS_Voice2Per(a0),d0
cmp.w AGO_OldPer2(pc),d0
bne.s .3
clr.w UPS_Voice2Per(a0)
.3 move.w UPS_Voice3Per(a0),d0
cmp.w AGO_OldPer3(pc),d0
bne.s .4
clr.w UPS_Voice3Per(a0)
.4 move.w UPS_Voice4Per(a0),d0
cmp.w AGO_OldPer4(pc),d0
bne.s .0
clr.w UPS_Voice4Per(a0)
.0
clr.w UPS_Enabled(a0)
movem.l (SP)+,D0/A0
rts
;-----------------------------------------------------------------------
; END